import request from '@/utils/request'

// 获取学科列表
export function getList(params) {
  return request({
    url: '/subjects',
    method: 'GET',
    params
  })
}

// 获取科目删除
export function delSubList(id) {
  return request({
    url: '/subjects/' + id,
    method: 'DELETE'
  })
}

// 获取学科详情
export function subdatails(id) {
  return request({
    url: '/subjects/' + id,
    method: 'GET'
  })
}

// 获取科目编辑
export function editSubList(id) {
  return request({
    url: '/subjects/' + id,
    method: 'PUT'
  })
}

// 科目添加
export function addSubList(data) {
  return request({
    url: '/subjects',
    method: 'POST',
    data
  })
}

// =============================================

// 获取目录列表
export function getMenusList(params) {
  return request({
    url: '/directorys',
    method: 'GET',
    params
  })
}

// 目录删除
export function delMenusList(id) {
  return request({
    url: '/directorys/' + id,
    method: 'DELETE'
  })
}

// 目录添加
export function addMenusList(data) {
  return request({
    url: '/subjects',
    method: 'POST',
    data
  })
}

// 目录编辑
export function editMenusList(id) {
  return request({
    url: '/subjects/' + id,
    method: 'PUT'
  })
}

// 获取目录详情
export function subMenusList(id) {
  return request({
    url: '/directorys/' + id,
    method: 'GET'
  })
}